var gulp = require("gulp");
var concat = require('gulp-concat');
var umd  = require('gulp-umd');
var connect = require('gulp-connect');

gulp.task('default', ['webserver']);

gulp.task('concat', function () {
    return gulp.src(['src/utils.js','src/reader.js'])
        .pipe(concat('reader.js'))
        .pipe(gulp.dest('dist'));
});

gulp.task("umd",['concat'], function () {
    return gulp.src("dist/reader.js")
        .pipe(umd())
        .pipe(gulp.dest("dist"));  //输出目录

});

gulp.task('webserver', function() {
    connect.server({
        livereload: true,
        port: 8080
    });
});